<?php
/**
 * .
 * User: sunxiaozhi
 * Date: 2019/5/15 9:36
 */

namespace common\models;

use Yii;
use yii\db\ActiveRecord;
use common\helpers\DependencyFileHelper;

class ArticleBase extends ActiveRecord
{
    /**
     * @param bool $insert
     * @param array $changedAttributes
     * @throws \yii\base\InvalidConfigException
     *
     * @var $dependencyFileHelper \common\helpers\DependencyFileHelper
     */
    public function afterSave($insert, $changedAttributes)
    {
        //更新缓存依赖文件
        $dependencyFileHelper = Yii::createObject([
                'class' => DependencyFileHelper::className(),
                'dependencyFileName' => 'siteAllInfo.txt',
            ]
        );

        $dependencyFileHelper->updateDependencyFile();

        parent::afterSave($insert, $changedAttributes); // TODO: Change the autogenerated stub
    }

}